﻿using SuperSurvey.DAO;
using SuperSurvey.Entity;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

namespace SuperSurvey.BUS
{
    public class LoginBUS
    {
        private LoginDAO loginDAO;
        public UserLogin logins(string usename)
        {
            loginDAO = new LoginDAO();
            DataTable myDataTable = new DataTable();
            myDataTable = loginDAO.Login(usename);
            UserLogin ad = null;
            if (myDataTable != null)
            {
                foreach (DataRow dr in myDataTable.Rows)
                {
                    string Usename = dr["Username"].ToString();
                    string password = dr["Password"].ToString();
                 ad = new UserLogin { 
                        UserName = Usename,
                        Password = password
                    };

                }
                return ad;
            }
            return null;
        }
    }
}